﻿<%@ Page Language="C#" AutoEventWireup="true" CodeFile="abc.aspx.cs" Inherits="LoginEx" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title>登录页</title>
    <link href="css/global.css" rel="stylesheet" type="text/css" />
   <style type="text/css">
    html{min-height:100%;height:auto;}
    body{ background: url(images/login_background.gif) repeat-x center bottom;}
   </style>
    
    <script src="js/JQuery/jquery-1.3.2.min.js" type="text/javascript"></script>
    <script src="js/Plug/common.js" type="text/javascript"></script>
    <script src="js/global.js" type="text/javascript"></script>
</head>
<body>
<object id="hid"
	  classid="clsid:DA2251E9-F079-4474-9599-94DBDE50B66C" codebase="http://www3.cityrehouse.com.cn/setup/cityrehouse.ocx#version=1,0,0,0" width="0" height="0" align="center" hspace="0" vspace="0">
</object>
    <form id="form1" runat="server">

    <div class="lg_logo"></div>
        <div class="lgmain">
        <div class="lg_bxbg">
            <div class="fmi_ACon">
            <div class="fmi_LgBxCon">
            <table width="100%" border="0" cellspacing="0" cellpadding="0" class="LgBxLst_tb">
              <tr>
                <td>&nbsp;</td>
                <td>&nbsp;</td>
                <td>&nbsp;</td>
              </tr>
              <tr>
                <th nowrap>用户名：</th>
                <td><input type="text" value="cxsh000001" id="txtcode" class="Ipt" style="width:160px;" onkeypress="javascript:if(event.keyCode==13){document.getElementById('txtpass').focus();}" onFocus="this.className='Ipt IptOnF'" onBlur="this.className='Ipt'" maxlength="50" tabindex="1"></td>
                <td>&nbsp;</td>
              </tr>
              <tr>
                <th nowrap>密 码：</th>
                <td><input type="password" value="111" id="txtpass" class="Ipt" style="width:160px;" onkeypress="javascript:if(event.keyCode==13){document.getElementById('btSubmit').onclick();}" onFocus="this.className='Ipt IptOnF'" onBlur="this.className='Ipt'" tabindex="2"></td>
                <td>&nbsp;</td>
              </tr>
                <tr>
                <td  colspan="2" class="Smb_Wp"><input type="button" id="btSubmit" onkeypress="javascript:if(event.keyCode==13){Onlogin();}" onclick="Onlogin()" value="登 录" class="Btn SmbBtn" onMouseOver="this.className='Btn SmbBtn BtnHv'" onMouseOut="this.className='Btn SmbBtn'" onMouseDown="this.className='Btn SmbBtn BtnDw'" tabindex="9">
                <input type="button" value="重置" onclick="getmac()" class="Btn SmbBtn" onMouseOver="this.className='Btn SmbBtn BtnHv'" onMouseOut="this.className='Btn SmbBtn'" onMouseDown="this.className='Btn SmbBtn BtnDw'" tabindex="9"/>
                </td>
              </tr>
              <tr>
                <td colspan="2" style="height:22px;"><span id="span_mac" style="color:#ff0000;"></span></td>
              </tr>
            </table>
            </div>
            </div>
            </div>
            </div>

            <div class="lgcopy">版权所有<span>©</span> 2010 易居中国&middot;上海易居臣信房地产经纪有限公司 保留所有权利</div>
    
    
    
    
    
    
    <!--<div>
    用户名<input type="text" id="txtcode" /><br/>
    密码<input type="password" id="txtpass" /><br/>
    
    <input type="button" onclick="Onlogin()" value="登录"/>
    <input type="button" value="重置" onclick="getmac()"/>
    </div>-->
    <div id="msg"></div>
    
    </form>
</body>
</html>
<script type="text/javascript">
    
    function Onlogin(){
        if ($("#txtcode").val().trim()=="")
        {
            $("#msg").html("请输入登陆名");
            return false;
        }
        
        if ($("#txtpass").val().trim()=="")
        {
            $("#msg").html("请输入密码");
            return false;
        }
        var ser=document.getElementById("hid").Caption;
        ser='18-A9-05-EF-74-98';
        
        $.ajax({
           type: "POST",
           url: "service/LoginHandler.ashx",
           data: "usercode=" + $("#txtcode").val().trim() +"&password=" + $("#txtpass").val().trim()+"&ser="+ser,
           success: function(msg){
                var obj = eval(msg);
                if (obj.result=="true")
                {
                    var tourl = DcGlobal.getQueryString("tourl");
                    if (tourl != null)
                        window.location = tourl;
                    else
                        window.location = "houseMgr.aspx";
                }else if(obj.result=='needchgpwd'){
                    alert(obj.msg);
                    window.location="PersonalInitPwd.aspx?userid="+obj.userid;
                }else if(obj.result=='nopower'){
                    $('#span_mac').text("当前授权号："+obj.mac);
                    alert(obj.msg);
                }else
                {
                    alert(obj.msg);
                }
            }
        });
    }
    
    function getmac()
    {
        //documenCaption
    }
</script>
